#define _CRT_SECURE_NO_WARNINGS
#include"vector.h"
#include<iostream>
#include<vector>
#include<string>
void test_vector1()
{
	my_vector::vector<int> v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);
	v1.push_back(6);
	//v1.erase(v1.end()-1);
	my_vector::vector<int> v2(v1);

	auto it = v1.begin();
	while (it != v1.end())
	{
		if ((*it)% 2 == 0)
		{
			it=v1.erase(it);
		}
		else
		++it;
	}

	for (auto e : v1)
	{
		std::cout << e << std::endl;
	}
}

void test_vector2()
{
	my_vector::vector<std::string> v3;
	v3.push_back("1111");
	v3.push_back("1112");
	v3.push_back("1113");
	v3.push_back("1114");
	v3.insert(v3.begin() + 1,"1234");
	v3.insert(v3.begin() + 3, "1234");
	v3.erase(v3.begin() + 3);
	v3.pop_back();
	for (auto e : v3)
	{
		std::cout << e << std::endl;
	}
}


void test_vector3()
{
	my_vector::vector<std::string> v3;
	my_vector::vector<std::string> v4;
	const my_vector:: vector<std::string> v5(10,"world");
	my_vector::vector<std::string> v6(v5.begin(),v5.end());
	v3.resize(10,"hello");
	v4 = v3;
	
	//v3.push_back("1111");
	//v3.push_back("1112");
	//v3.push_back("1113");
	//v3.push_back("1114");
	//v3.insert(v3.begin() + 1, "1234");
	//v3.insert(v3.begin() + 3, "1234");
	//v3.erase(v3.begin() + 3);
	for (auto &e : v4)
	{
		std::cout << e << std::endl;
	}
	for (size_t i = 0; i < v5.size(); i++)
	{
		std::cout << v5[i] << std::endl;
	}

	for (auto& e : v6)
	{
		std::cout << e << std::endl;
	}
}

void test_vector4()
{
	my_vector::vector<std::string> v1;
	v1.reserve(10);
	for (size_t i = 0; i < 10; i++)
	{
		v1.push_back("1");
	}
	for (auto& e : v1)
	{
		std::cout << e << std::endl;
	}
}

int main()
{
	test_vector4();

	return 0;
}


